<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
var index=0;
var temp=Array();
var s=Array();
function dianji(a) {
	var c=a;
	//alert(c);
	s[index]=c;
	index=index+1;
}
function move() {
	for(var i=0;i<s.length;i++){
		var a=s[i];
	temp[i]=document.getElementById(a);	
		//alert(temp[i]);
	}
	for(var i=0;i<temp.length;i++){
		var b=temp[i];
		var x=document.getElementById("a1");
		//alert(x);
		//x.removeChild(b);	
		}
	for(var i=0;i<temp.length;i++){
		var y=document.getElementById("b1")
		y.appendChild(temp[i]);	
		}
		
	}

</script>
</head>
<body>
<select multiple="3" id="a1">
<option onclick="dianji(1)" id="1">苹果</option>
<option onclick="dianji(2)" id="2">香蕉</option>
<option onclick="dianji(3)" id="3">梨子</option>
</select><br>
<button onclick="move()">下移动</button><br>
<select multiple="3" id="b1">
<option id="4">桃子</option>
<option id="5">菠萝</option>
<option id="6">枇杷</option>
</select>
</body>
</html>